﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Esign.Net.Input;
using Newtonsoft.Json;

namespace Esign.Net.Output
{
    [Serializable]
    public class SignFlow
    {
        [Serializable]
        public class CreateByFileOutPut
        {
            /// <summary>
            /// 流程id
            /// </summary>
            [JsonProperty("signFlowId")]
            public string SignFlowId { get; set; }
        }

        [Serializable]
        public class SignUrlOutPut
        {
            /// <summary>
            /// 短网址
            /// </summary>
            [JsonProperty("shortUrl")]
            public string ShortUrl { get; set; }

            /// <summary>
            /// 长网址
            /// </summary>
            [JsonProperty("url")]
            public string Url { get; set; }
        }

        [Serializable]
        public class Detail
        {
            [JsonProperty("attachments")]
            public IList<Input.SignFlow.Attachment> Attachments { get; set; }

            [JsonProperty("copiers")]
            public IList<object> Copiers { get; set; }

            [JsonProperty("docs")]
            public IList<Input.SignFlow.Doc> Docs { get; set; }

            [JsonProperty("rescissionSignFlowIds")]
            public object RescissionSignFlowIds { get; set; }

            [JsonProperty("rescissionStatus")]
            public int RescissionStatus { get; set; }

            [JsonProperty("signers")]
            public IList<Input.SignFlow.Signer> Signers { get; set; }

            [JsonProperty("signFlowConfig")]
            public Input.SignFlow.SignFlowConfig SignFlowConfig { get; set; }

            [JsonProperty("signFlowCreateTime")]
            public long SignFlowCreateTime { get; set; }

            /// <summary>
            /// 签署流程描述
            /// 如果流程已拒签或已撤销，并且存在拒签或撤回原因，流程描述显示为原因,，否则默认为流程状态描述
            /// </summary>
            [JsonProperty("signFlowDescription")]
            public string SignFlowDescription { get; set; }

            [JsonProperty("signFlowFinishTime")]
            public object SignFlowFinishTime { get; set; }

            [JsonProperty("signFlowInitiator")]
            public Input.SignFlow.SignFlowInitiator SignFlowInitiator { get; set; }

            [JsonProperty("signFlowStartTime")]
            public long SignFlowStartTime { get; set; }

            /// <summary>
            /// 当前流程的状态 0 - 草稿
            /// 1 - 签署中
            /// 2 - 完成
            /// 3 - 撤销
            /// 5 - 过期（签署截至日期到期后触发）
            /// 7 - 拒签
            /// </summary>
            [JsonProperty("signFlowStatus")]
            public int SignFlowStatus { get; set; }
        }

    }
}
